import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs";
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/houseManager"
//项目字典
const applyRoomApi = {
    //根据部门展示对应部门用户
    GetUserByDeptId: function (deptId) {
        const data = {
            deptId
        };
        return request({
            url: baseUrl + "/officeRoomIn/getUserByDeptId",
            method: "post",
            data: qs.stringify(data),
        });
    },
    //申请
    AddApply: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/officeApply/addApply", data, config)
    },
    //获取登录人信息
    GetLoginUserInfo: function () {

        return request({
            url: baseUrl + '/officeApply/getLoginUserInfo',
            method: 'post',

        })
    },
    //获取职称信息 列表数据
    List: function () {
        const data = {
            enablePaging: 1
        }
        return request({
            url: baseUrl + '/houseUserTitle/list',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //获取退宿房间 列表数据
    ListRoom: function () {
        return request({
            url: baseUrl + '/officeRoomIn/queryHouseListByUserId',
            method: 'post',
        })
    },
    //判断用户是否居住
    getLiveStatus: function (oldRoomId) {
        const data = {
            houseRoomInId: oldRoomId
        }
        return request({
            url: baseUrl + '/officeRoomIn/validation',
            method: 'post',
            data: qs.stringify(data)
        })
    },

}
export { applyRoomApi }
